//
//  MineOrderItem.m
//  JiuJiuShangCheng
//
//  Created by jiujiukeji on 2018/7/5.
//  Copyright © 2018年 jiujiukeji. All rights reserved.
//

#import "MineOrderItem.h"

@implementation MineOrderItem

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setUpUI];
    }
    return self;
}
- (void)setUpUI
{
    self.btn1 = [UIButton buttonWithTitle:@"待付款" fontSize:14 titleColor:mineTextColor background:kClearColor cornerRadius:0];
    [self.btn1 setImage:UIImageNamed(@"daifukuan") forState:(UIControlStateNormal)];
    [self.btn1 setImageEdgeInsets:UIEdgeInsetsMake(-self.btn1.titleLabel.intrinsicContentSize.height-10, 0, 0, -self.btn1.titleLabel.intrinsicContentSize.width)];
    [self.btn1 setTitleEdgeInsets:UIEdgeInsetsMake(self.btn1.currentImage.size.height+5, -self.btn1.currentImage.size.width, 0, 0)];
    [self addSubview:self.btn1];
    [self.btn1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self);
        make.size.mas_offset(CGSizeMake(kScreenWidth/5, rateHeight(170)));
        make.centerY.equalTo(self);
    }];
    
    self.btn2 = [UIButton buttonWithTitle:@"待发货" fontSize:14 titleColor:mineTextColor background:kClearColor cornerRadius:0];
    [self.btn2 setImage:UIImageNamed(@"daifahuo") forState:(UIControlStateNormal)];
    [self.btn2 setImageEdgeInsets:UIEdgeInsetsMake(-self.btn2.titleLabel.intrinsicContentSize.height-10, 0, 0, -self.btn2.titleLabel.intrinsicContentSize.width)];
    [self.btn2 setTitleEdgeInsets:UIEdgeInsetsMake(self.btn2.currentImage.size.height+5, -self.btn2.currentImage.size.width, 0, 0)];
    [self addSubview:self.btn2];
    [self.btn2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(kScreenWidth/5);
        make.size.mas_offset(CGSizeMake(kScreenWidth/5, rateHeight(170)));
        make.centerY.equalTo(self);
    }];
    
    self.btn3 = [UIButton buttonWithTitle:@"待收货" fontSize:14 titleColor:mineTextColor background:kClearColor cornerRadius:0];
    [self.btn3 setImage:UIImageNamed(@"daishouhuo") forState:(UIControlStateNormal)];
    [self.btn3 setImageEdgeInsets:UIEdgeInsetsMake(-self.btn3.titleLabel.intrinsicContentSize.height-10, 0, 0, -self.btn3.titleLabel.intrinsicContentSize.width)];
    [self.btn3 setTitleEdgeInsets:UIEdgeInsetsMake(self.btn3.currentImage.size.height+5, -self.btn3.currentImage.size.width, 0, 0)];
    [self addSubview:self.btn3];
    [self.btn3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset((kScreenWidth/5)*2);
        make.size.mas_offset(CGSizeMake(kScreenWidth/5, rateHeight(170)));
        make.centerY.equalTo(self);
    }];
    
    self.btn4 = [UIButton buttonWithTitle:@"已签收" fontSize:14 titleColor:mineTextColor background:kClearColor cornerRadius:0];
    [self.btn4 setImage:UIImageNamed(@"yiqianshou") forState:(UIControlStateNormal)];
    [self.btn4 setImageEdgeInsets:UIEdgeInsetsMake(-self.btn4.titleLabel.intrinsicContentSize.height-10, 0, 0, -self.btn4.titleLabel.intrinsicContentSize.width)];
    [self.btn4 setTitleEdgeInsets:UIEdgeInsetsMake(self.btn4.currentImage.size.height+5, -self.btn4.currentImage.size.width, 0, 0)];
    [self addSubview:self.btn4];
    [self.btn4 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset((kScreenWidth/5)*3);
        make.size.mas_offset(CGSizeMake(kScreenWidth/5, rateHeight(170)));
        make.centerY.equalTo(self);
    }];
    
    self.btn5 = [UIButton buttonWithTitle:@"退款/维权" fontSize:14 titleColor:mineTextColor background:kClearColor cornerRadius:0];
    [self.btn5 setImage:UIImageNamed(@"tuikuan") forState:(UIControlStateNormal)];
    [self.btn5 setImageEdgeInsets:UIEdgeInsetsMake(-self.btn5.titleLabel.intrinsicContentSize.height-10, 0, 0, -self.btn5.titleLabel.intrinsicContentSize.width)];
    [self.btn5 setTitleEdgeInsets:UIEdgeInsetsMake(self.btn5.currentImage.size.height+5, -self.btn5.currentImage.size.width, 0, 0)];
    [self addSubview:self.btn5];
    [self.btn5 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset((kScreenWidth/5)*4);
        make.size.mas_offset(CGSizeMake(kScreenWidth/5, rateHeight(170)));
        make.centerY.equalTo(self);
    }];
    
    self.redLB1 = [UILabel labelWithText:@"0" textColor:UIColorFromRGB(0xff2828) fontSize:10];
    self.redLB1.layer.masksToBounds = YES;
    self.redLB1.layer.borderColor = UIColorFromRGB(0xff2828).CGColor;
    self.redLB1.layer.borderWidth = 1;
    self.redLB1.textAlignment = NSTextAlignmentCenter;
    self.redLB1.layer.cornerRadius = rateWidth(15);
    self.redLB1.backgroundColor = UIColorWhite;
    [self addSubview:self.redLB1];
    [self.redLB1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_offset(CGSizeMake(rateWidth(30), rateWidth(30)));
        make.centerX.equalTo(self.btn1.mas_centerX).offset(15);
        make.centerY.equalTo(self.btn1.mas_centerY).offset(-20);
    }];
    
    self.redLB2 = [UILabel labelWithText:@"0" textColor:UIColorFromRGB(0xff2828) fontSize:10];
    self.redLB2.layer.masksToBounds = YES;
    self.redLB2.layer.borderColor = UIColorFromRGB(0xff2828).CGColor;
    self.redLB2.layer.borderWidth = 1;
    self.redLB2.textAlignment = NSTextAlignmentCenter;
    self.redLB2.layer.cornerRadius = rateWidth(15);
    self.redLB2.backgroundColor = UIColorWhite;
    [self addSubview:self.redLB2];
    [self.redLB2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_offset(CGSizeMake(rateWidth(30), rateWidth(30)));
        make.centerX.equalTo(self.btn2.mas_centerX).offset(15);
        make.centerY.equalTo(self.btn2.mas_centerY).offset(-20);
    }];
    
    self.redLB3 = [UILabel labelWithText:@"0" textColor:UIColorFromRGB(0xff2828) fontSize:10];
    self.redLB3.layer.masksToBounds = YES;
    self.redLB3.layer.borderColor = UIColorFromRGB(0xff2828).CGColor;
    self.redLB3.layer.borderWidth = 1;
    self.redLB3.textAlignment = NSTextAlignmentCenter;
    self.redLB3.layer.cornerRadius = rateWidth(15);
    self.redLB3.backgroundColor = UIColorWhite;
    [self addSubview:self.redLB3];
    [self.redLB3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_offset(CGSizeMake(rateWidth(30), rateWidth(30)));
        make.centerX.equalTo(self.btn3.mas_centerX).offset(15);
        make.centerY.equalTo(self.btn3.mas_centerY).offset(-20);
    }];
    
    self.redLB4 = [UILabel labelWithText:@"0" textColor:UIColorFromRGB(0xff2828) fontSize:10];
    self.redLB4.layer.masksToBounds = YES;
    self.redLB4.layer.borderColor = UIColorFromRGB(0xff2828).CGColor;
    self.redLB4.layer.borderWidth = 1;
    self.redLB4.textAlignment = NSTextAlignmentCenter;
    self.redLB4.layer.cornerRadius = rateWidth(15);
    self.redLB4.backgroundColor = UIColorWhite;
    [self addSubview:self.redLB4];
    [self.redLB4 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_offset(CGSizeMake(rateWidth(30), rateWidth(30)));
        make.centerX.equalTo(self.btn4.mas_centerX).offset(15);
        make.centerY.equalTo(self.btn4.mas_centerY).offset(-20);
    }];
    
    self.redLB5 = [UILabel labelWithText:@"0" textColor:UIColorFromRGB(0xff2828) fontSize:10];
    self.redLB5.layer.masksToBounds = YES;
    self.redLB5.layer.borderColor = UIColorFromRGB(0xff2828).CGColor;
    self.redLB5.layer.borderWidth = 1;
    self.redLB5.textAlignment = NSTextAlignmentCenter;
    self.redLB5.layer.cornerRadius = rateWidth(15);
    self.redLB5.backgroundColor = UIColorWhite;
    [self addSubview:self.redLB5];
    [self.redLB5 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_offset(CGSizeMake(rateWidth(30), rateWidth(30)));
        make.centerX.equalTo(self.btn5.mas_centerX).offset(15);
        make.centerY.equalTo(self.btn5.mas_centerY).offset(-20);
    }];
    self.redLB1.hidden = YES;
    self.redLB2.hidden = YES;
    self.redLB3.hidden = YES;
    self.redLB4.hidden = YES;
    self.redLB5.hidden = YES;
}

@end
